package com.syyo.gulimall.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.syyo.common.to.mq.SeckillOrderTo;
import com.syyo.gulimall.order.domain.entity.OrderEntity;
import com.syyo.gulimall.order.domain.req.OrderReq;
import com.syyo.gulimall.order.domain.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author syyo
 * @email syyo@gmail.com
 * @date 2021-01-20 10:01:14
 */
public interface OrderService extends IService<OrderEntity> {

    /**
     * 新增
     */
    int add(OrderReq req);

    /**
     * 删除
     */
    int del(Integer id);

    /**
     * 编辑
     */
    int edit(OrderReq req);

    /**
     * 详情
     */
    OrderEntity findOne(Integer id);

    /**
     * 列表
     */
    IPage<OrderEntity> findAll(Integer pageNum, Integer pageSize, OrderReq req);

    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    OrderSubmitRespVo submitOrder(OrderSubmitVo orderSubmitVo);

    OrderEntity getOrderStatus(String orderSn);

    void closeOrder(OrderEntity entity);

    PayVo getOrderPay(String orderSn);

    IPage<OrderEntity> listWithItem(Integer pageNum, Integer pageSize, Map<String,Object> params);

    String handleAliPay(PayAsyncVo vo);

    void createSeckillOrder(SeckillOrderTo to);
}

